#include <iostream>
#include <cmath>
using namespace std;
class Shapes {
public:
	virtual double area() = 0;
	virtual ~Shapes() {};
};
class Rectangle :public Shapes {
private:
	double width;
	double height;
public:
	Rectangle(double w, double h) : width(w), height(h) {}
	double area() {
		return width * height;
	}
};
class Circle : public Shapes {
	double radius;
public:
	Circle(double r) : radius(r) {}
	double area() {
		return atan(1.0)*4 * radius * radius;
	}
};
int main()
{
	Shapes* shapes[2];
	shapes[0] = new Rectangle(10.0, 5.0);
	shapes[1] = new Circle(1.0);
	for (int i = 0; i < 2; ++i) {
		cout << "Shape " << i + 1 << " area: " << shapes[i]->area() << endl;
	}
	for (int i = 0; i < 2; ++i) {
		delete shapes[i];
	}
	system("pause");
	return 0;
}